def process_file_line_by_line(read_path,write_path,num):
  with open(write_path, 'w') as filew:
    with open(read_path, 'r') as filer:
        counter = 0
        for line in filer:
            filew.write("ram_symbol" + str(num) + "[" + str(counter) + "] <= 8'b"+ line.strip() + ";\n")
            counter += 1


common_name = 'Murax.v_toplevel_system_ram_ram_symbol'

for num in range(0,4):
  read_path   = common_name + str(num) + '.bin'
  write_path  = 'Murax_ram_symbol_' + str(num) + '.v'
  process_file_line_by_line(read_path,write_path,num)
